package com.engine4cloud.tdf.supervision.feign;

import com.engine4cloud.tdf.common.core.constant.SecurityConstants;
import com.engine4cloud.tdf.common.core.constant.ServiceNameConstants;
import com.engine4cloud.tdf.common.core.util.R;
import com.engine4cloud.tdf.common.data.web.response.PageInfo;
import com.engine4cloud.tdf.common.data.web.response.Params;
import com.engine4cloud.tdf.supervision.dto.create.TerminalBiologyCreateDTO;
import com.engine4cloud.tdf.supervision.dto.query.TerminalBiologyQueryDTO;
import com.engine4cloud.tdf.supervision.dto.result.JzdxTerminalBiologyResultDTO;
import com.engine4cloud.tdf.supervision.dto.result.TerminalBiologyResultDTO;
import com.engine4cloud.tdf.supervision.dto.update.TerminalBiologyUpdateDTO;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 矫正对象-生物特征
 *
 * @author sh
 * @date 2024-08-02 15:07:07
 */
@FeignClient(contextId = "RemoteJzdxBiologyFeatureService", value = ServiceNameConstants.SUPERVISION_SERVER)
public interface RemoteJzdxBiologyFeatureService {

    /**
     * 新增矫正对象现场签到
     *
     * @param dto 矫正对象现场签到
     * @return R
     */
    @PostMapping("/inner/biology")
    R<Boolean> create(@RequestBody TerminalBiologyCreateDTO dto, @Valid @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 新增矫正对象现场签到
     *
     * @param dto 矫正对象现场签到
     * @return R
     */
    @PutMapping("/inner/biology")
    R<Boolean> update(@Valid @RequestBody TerminalBiologyUpdateDTO dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 分页查询
     *
     * @param page 分页对象
     * @return R<PageInfo < RcglHelpResultDTO>>
     */
    @GetMapping("/inner/biology/page")
    R<PageInfo<JzdxTerminalBiologyResultDTO>> pageList(@RequestParam("page") Params page, @Valid @RequestParam("dto") TerminalBiologyQueryDTO dto,
                                                       @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 通过身份证号查询
     *
     * @param identity 身份证号
     * @return R
     */
    @Operation(summary = "通过身份证号查询", description = "通过身份证号查询")
    @GetMapping("/inner/biology/{identity}")
    R<TerminalBiologyResultDTO> getByIdentity(@PathVariable("identity") String identity,
                                                     @RequestHeader(SecurityConstants.FROM) String from);

}
